Skip to content

fix(google-sheets): normalise header case and fix monthly COUNTIFS formula #373

Merged
sgresh-stripe merged 2 commits into
mainfrom
sgresh/formatfix
May 13, 2026
Merged

fix(google-sheets): normalise header case and fix monthly COUNTIFS formula #373
sgresh-stripe merged 2 commits into
mainfrom
sgresh/formatfix

Conversation

@sgresh-stripe
Copy link
Copy Markdown

@sgresh-stripe sgresh-stripe commented May 8, 2026

Summary

Fixes PR comments from here: #369

  • Header case normalisation: fieldToDisplay now lowercases each word segment before capitalising the first, preventing mixed-case field names (e.g. API_version) from leaking uppercase into column headers.
  • Monthly count formula: Replaces COUNTIFS with SUMPRODUCT + DATEVALUE(LEFT(...,10)) to correctly parse ISO timestamp strings into Sheets date serials; the previous COUNTIFS approach failed on text-formatted dates.
  • Tests: Adds a fieldToDisplay / displayToField roundtrip test suite covering snake_case, system fields, and case normalisation.

Test plan

  • pnpm test passes (unit tests cover new fieldToDisplay/displayToField cases)
  • Manually verify Google Sheets header row shows correct sentence-case labels for mixed-case source fields
  • Manually verify "New Customers by Month" example section counts correctly in a real spreadsheet

@sgresh-stripe sgresh-stripe merged commit e049872 into main May 13, 2026
18 of 19 checks passed
@sgresh-stripe sgresh-stripe deleted the sgresh/formatfix branch May 13, 2026 01:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants